/**
 * 表单元素构造服务
 * @author werts
 */
import { Injectable } from '@angular/core';
import { FormGroup, Validators, FormControl, FormBuilder } from '@angular/forms';

import { FormsElementsBase } from './class.forms.elements.base';

@Injectable()
export class FormControlBuildService {
    forms: FormGroup;

    constructor(private formbuilder: FormBuilder) { }

    buildFormCtrol(formsArray?: FormsElementsBase<any>[], formType?: string) {
        this.forms = this.formbuilder.group({
            userName: ['']
        });
        return this.forms;
    }
}